﻿using System;
using System.Configuration;
using System.Net;
using System.Net.Mail;
using System.Net.Mime;
using System.Threading;
using System.ComponentModel;


public partial class EmailSender : AlbumPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        lnkToAlbum.NavigateUrl = @"~/AlbumViewer.aspx?" + AlbumHelper.GetAlbumIdQueryPair(AlbumId);
        string authority = Request.Url.Authority.ToString();
        emailControl.MessageText = "http://" + authority + "/confirmit/AlbumViewer.aspx?" + AlbumHelper.AlbumIdKeyString + "=" + Server.UrlEncode(AlbumId.ToString());
    }
    protected void btnSend_Click(object sender, EventArgs e)
    {
        string resourceKey = EmailManager.SendEmail(emailControl.Adressees,emailControl.MessageText);
        emailControl.Errors = (string)GetLocalResourceObject(resourceKey);
    }
}